package com.swfee.qinben.httpactions;

import java.util.List;

import com.swfee.qinben.dto.req.CommentReqDto;
import com.swfee.qinben.dto.req.ReplyCommentReqDto;
import com.swfee.qinben.dto.rsp.CommentRspDto;
import com.swfee.qinben.dto.rsp.ResultRspDto;
import com.swfee.qinben.httpactions.base.ReqBaseAction;

public class CommentAction extends ReqBaseAction<CommentReqDto,CommentRspDto> {

	
	public CommentAction() {
		super();
		setDefaultRspClass(CommentRspDto.class);
	}
	
	@Override
	public String getBaseActionUrl() {
		return "/webService/MedicalCare.CommonServices/Commnet.asmx";
	}
	
	
	public List<CommentRspDto> getComments(Integer scheduleId){
		String actionName = "/GetComments";
		CommentReqDto req = new CommentReqDto();
		req.setScheduleId(scheduleId);
		return  doHttpForList(req, actionName);
	}
	

	public ResultRspDto replyComment(Integer scheduleId,String content ){
		String actionName = "/GetComments";
		ReplyCommentReqDto req = new ReplyCommentReqDto();
		req.setComment(content);
		req.setScheduleId(scheduleId);
		return  (ResultRspDto) doHttpForObject(req, actionName,ResultRspDto.class);
	}
	
	public ResultRspDto sendComment(Integer scheduleId,String content ){
		String actionName = "/SendComment";
		ReplyCommentReqDto req = new ReplyCommentReqDto();
		req.setComment(content);
		req.setScheduleId(scheduleId);
		return  (ResultRspDto) doHttpForObject(req, actionName,ResultRspDto.class);
	}
	
	
	
}
